<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>项目列表</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}

.tabfont01 {
	font-family: "宋体";
	font-size: 9px;
	color: #555555;
	text-decoration: none;
	text-align: center;
}

.font051 {
	font-family: "宋体";
	font-size: 12px;
	color: #333333;
	text-decoration: none;
	line-height: 20px;
}

.font201 {
	font-family: "宋体";
	font-size: 12px;
	color: #FF0000;
	text-decoration: none;
}

.button {
	font-family: "宋体";
	font-size: 14px;
	height: 37px;
}

html {
	overflow-x: auto;
	overflow-y: auto;
	border: 0;
}
-->
</style>

<link href="../css/css.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript">
	
</script>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
</head>
<SCRIPT language=JavaScript>
	
	function selectAll() {
		var obj = document.fom.elements;
		for ( var i = 0; i < obj.length; i++) {
			if (obj[i].name == "delid") {
				obj[i].checked = true;
			}
		}
	}

	function unselectAll() {
		var obj = document.fom.elements;
		for ( var i = 0; i < obj.length; i++) {
			if (obj[i].name == "delid") {
				if (obj[i].checked == true)
					obj[i].checked = false;
				else
					obj[i].checked = true;
			}
		}
	}

	function deleteAll() {
		var obj = document.fom.elements;
		var delValue = "";
		for( var i = 0; i < obj.length; i++) {
			if (obj[i].name == "delid") {
				if (obj[i].checked == true) {
					delValue = obj[i].value + "," + delValue;
				}
			}
		}
		location.href("../pm/buildProject!deleteAll.action?str=" + delValue);
	}
	
	function search() {
		var obj = document.getElementById("name").value;
		location.href("../pm/buildProject!search.action?name=" + obj);
	}
	
</SCRIPT>

<body>
	<form action="../pm/buildProject" onsubmit="return validate();" name="fom">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td height="30">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td height="62" background="../images/nav04.gif">

								<table width="98%" border="0" align="center" cellpadding="0"
									cellspacing="0">
									<tr>
										<td width="21"><img src="../images/ico07.gif" width="20"
											height="18" /></td>
										<td width="538">请输入项目名称进行查找：
										 <input id="name" type="text" size="12" /> 
										 <input	name="Submit4" type="button" class="right-button02"	value="查 询" onclick="search()"/>
										</td>
										</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
			
				<td><table id="subtree1" style="DISPLAY:" width="100%"
						border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td><table width="95%" border="0" align="center"
									cellpadding="0" cellspacing="0">
									<tr>
										<td height="20"><span class="newfont07">选择：<a
												href="#" class="right-font08" onclick="selectAll();">全选</a>-<a
												href="#" class="right-font08" onclick="unselectAll();">反选</a></span>
											<input name="Submit" type="button" class="right-button08"
											value="删除所选任务"
											onclick="deleteAll()" /> <input
											name="Submit2" type="button" class="right-button08"
											value="添加任务"
											onclick="location='../pm/buildProject!addInput.action'" /></td>
									</tr>
									<tr>
										<td height="40" class="font42">
											<table width="100%" border="0" cellpadding="4"
												cellspacing="1" bgcolor="#464646" class="newfont03">
												<tr class="CTitle">
													<td height="22" colspan="7" align="center"
														style="font-size: 16px">立项列表</td>
												</tr>
												<tr bgcolor="#EEEEEE">
											
													<td width="4%" align="center" height="30">选择</td>
											
													<td width="10%" align="center">项目编号</td>
													<td width="20%" align="center">项目名称</td>
													<td width="20%" align="center">所属单位</td>
													<td width="15%" align="center">提交时间</td>
													<td width="10%"align="center">评审状态</td>
													<td align="center">操作</td>
												</tr>
												
												<s:if test="#request.pageBean.list == null || #request.pageBean.list.isEmpty()">
												<tr bgcolor="#FFFFFF"><td colspan="7" align="center">查询结果为空</td></tr>
												</s:if>
												
												<s:iterator value="#request.pageBean.list" var="p">
												<tr bgcolor="#FFFFFF">
												<s:if test='#p.status == "2"'>
													<td align="center" height="20"></td>
												</s:if>
												<s:else>
													<td align="center" height="20"><input type="checkbox" name="delid" value="<s:property value="#p.p_id" />"/></td>
												</s:else>
													<td align="center"><s:property value="#p.p_id" /></td>
													<td><s:property value="#p.name" /></td>
													<td><s:property value="#p.company" /></td>
													<td align="center"><s:property value="#p.a_time" /></td>
													<s:if test='#p.status != "2"'>
														<td align="center"><span class="red"><s:property value="#p.toChange()" /></span></td>
													</s:if>
														
													<s:else>
														<td align="center"><s:property value="#p.toChange()" /></td>
													</s:else>
													<td align="center">
													<s:if test='#session.user.grade == "low"'>
														<a href="../pm/buildProject!updateInput.action?project.p_id=<s:property value="#p.p_id" />">-修改-</a>
														<a href="../pm/buildProject!view.action?project.p_id=<s:property value="#p.p_id" />">-查看详情-</a> 
														<s:if test='#p.status != "2"'>
															<a href="../pm/buildProject!delete.action?project.p_id=<s:property value="#p.p_id" />">-删除-</a>
														</s:if>
													</s:if>
													<s:else>
														<s:if test="#p.status == 0">
														<a href="../pm/buildProject!review_input.action?project.p_id=<s:property value="#p.p_id" />">审批</a> 
														</s:if>
													</s:else>
													</td>
												</tr>
												</s:iterator>
												
											</table>
										</td>
									</tr>
								</table>
								<table width="95%" border="0" align="center" cellpadding="0"
									cellspacing="0">
									<tr>
										<td height="6"><img src="../images/spacer.gif" width="1"
											height="1" /></td>
									</tr>
									<tr>
										<td height="33"><table width="100%" border="0"
												align="center" cellpadding="0" cellspacing="0"
												class="right-font08">
												<tr>
													<td width="50%">
													 第 <span class="right-text09"><s:property value="#request.pageBean.currentPage"/></span> 页
													共 <span class="right-text09"><s:property value="#request.pageBean.totalPage"/></span> 页 
													共 <span class="right-text09"><s:property value="#request.pageBean.allRows"/></span> 条记录
													</td>
													<td width="49%" align="right">[
														<s:if test="#request.pageBean.currentPage == 1">
           									 				<span class="right-font08">首页&nbsp;&nbsp;&nbsp;上一页</span>
       													</s:if>
														<s:else>
														<a href="../pm/buildProject" class="right-font08">首页</a>&nbsp;&nbsp;&nbsp;
            											<a href="../pm/buildProject?page=<s:property value="#request.pageBean.currentPage-1" />" class="right-font08">上一页</a>
        												</s:else>
        												
														<s:if test="#request.pageBean.currentPage != #request.pageBean.totalPage">
           												<a href="../pm/buildProject?page=<s:property value="#request.pageBean.currentPage + 1" />" class="right-font08">下一页</a>
            											&nbsp;&nbsp;&nbsp;
            											<a href="../pm/buildProject?page=<s:property value="#request.pageBean.totalPage" />" class="right-font08">尾页</a>
        												</s:if>
        
        												<s:else>
            											<span class="right-font08">下一页&nbsp;&nbsp;&nbsp;尾页</span>
        												</s:else>
														
													
													
													
														] 转至：
													</td>
													<td width="1%"><table width="20" border="0"
															cellspacing="0" cellpadding="0">
															<tr>
																<td width="1%">
																<input name="page" type="text" class="right-textfield03" size="1" />
																</td>
																<td width="87%">
																<input type="submit" class="right-button06" value="" />
																</td>
															</tr>
														</table></td>
												</tr>
											</table></td>
									</tr>
								</table></td>
						</tr>
					</table></td>
			</tr>
		</table>
	</form>
</body>
</html>
